package com.example.demo.controller;

import com.example.demo.entity.Story;
import com.example.demo.service.StoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/test")
public class TestsController {

    @Autowired
    StoryService storyService;

    @GetMapping("/t1")
    public List<Story> t1() {
        List<Story> list = storyService.list();
        return list;
    }
}
